package lab02.test05;

public class Cube {
    private float length;
    private float width;
    private float height;

    public Cube(){

    }

    public Cube(float length, float width, float height) {
        this.length = length;
        this.width = width;
        this.height = height;
    }

    public float getLength() {
        return length;
    }

    public void setLength(float length) {
        this.length = length;
    }

    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }
    //定义volume方法求解立方体的体积
    public void volume(){
        float volume;
        volume = length * width * height;
        System.out.println("该立方体的体积为：" + volume);
    }
}
